<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>后台管理中心</title>
<?php echo $this->_var['system_css']; ?>
<?php echo $this->_var['system_js']; ?>
</head>
<body>
<?php echo $this->fetch('message.html'); ?>
<div class="pad-lr-10" style="margin-top: 15px;">
  <form name="searchform" action="<?php echo $this->_var['site_url']; ?>admin/user/search/" method="post" >
    <table width="100%" cellspacing="0" class="search-form">
      <tbody>
        <tr>
          <td><div class="explain-col"> &nbsp;&nbsp;选择用户组：
              <select name="group_id" id="group_id">
                <option value="">==全部==</option>
                
                 <?php echo $this->_var['select_group_list']; ?>
              
              </select>
              &nbsp;&nbsp;用户状态：
              <select name="status" id="status">
                <option value="">==全部==</option>
                <option value="user_unactive">未激活</option>
                <option value="user_actived">已激活</option>
                <option value="user_delete">封号</option>
              
              </select>
              用户名：
              <input name="keywords" type="text"  class="input-text" />
              <input type="submit" name="search" class="button" value="搜索" />
            </div></td>
        </tr>
      </tbody>
    </table>
  </form>
  <form name="myform" action="<?php echo $this->_var['action']; ?>" method="post">
    <div class="table-list">
      <table width="100%" cellspacing="0">
        <thead>
          <tr>
            <th width="45">ID</th>
            <th>用户名</th>
            <th>用户组</th>
           
            <th>审核状态</th>
          
            <th>E-mail</th>
            <th>最后登录时间</th>
            <th>管理操作</th>
          </tr>
        </thead>
        <tbody>
        
        <?php $_from = $this->_var['user_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'list');if (count($_from)):
    foreach ($_from AS $this->_var['list']):
?>
        <tr>
          <td align="center"><?php echo $this->_var['list']['id']; ?></td>
          <td align="center"><?php echo $this->_var['list']['username']; ?>
            
            <?php if ($this->_var['list']['is_admin'] == 1): ?>
            &nbsp;&nbsp;(<a href="<?php echo $this->_var['site_url']; ?>admin/user/set_admin/<?php echo $this->_var['list']['id']; ?>" style="color:red">取消管理员</a>)
            <?php else: ?>
            &nbsp;&nbsp;(<a href="<?php echo $this->_var['site_url']; ?>admin/user/set_admin/<?php echo $this->_var['list']['id']; ?>" style="color:red">设为管理员</a>)
            <?php endif; ?> </td>
          <td align="center"><?php echo $this->_var['list']['group_name']; ?></td>
          
          <td align="center" class="<?php echo $this->_var['list']['status']; ?>"><?php if ($this->_var['list']['is_admin'] != 1): ?> <?php echo __($this->_var['list']['status']); ?> <?php endif; ?></td>
          
          <td align="center"><?php echo $this->_var['list']['email']; ?></td>
          <td align="center"><?php echo Date::timeformat($this->_var['list']['last_time'],2); ?></td>
          <td align="center"><a href="<?php echo $this->_var['site_url']; ?>admin/user/edit/<?php echo $this->_var['list']['id']; ?>">修改</a> | 
          <?php if ($this->_var['list']['is_admin'] != 1): ?>
            <?php if ($this->_var['list']['status'] == 'user_unactive'): ?> 
            <a  href="/admin/user/status/<?php echo $this->_var['list']['id']; ?>/user_actived"> 激活  </a>  | 
            <?php elseif ($this->_var['list']['status'] == 'user_actived'): ?>
            <a href="/admin/user/status/<?php echo $this->_var['list']['id']; ?>/user_unactive"> 取消激活 </a> | 
            <?php endif; ?> 
            <?php if ($this->_var['list']['status'] == 'user_delete'): ?> 
            <a  href="/admin/user/status/<?php echo $this->_var['list']['id']; ?>/user_actived"> 解封 </a>  | 
            <?php else: ?>
            <a href="/admin/user/status/<?php echo $this->_var['list']['id']; ?>/user_delete"> 封号 </a> | 
            <?php endif; ?> 
          <?php endif; ?>
          <a class="delete" href="javascript:void(0);" title="<?php echo $this->_var['list']['username']; ?>" id="<?php echo $this->_var['list']['id']; ?>">删除</a></td>
        </tr>
        <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
          </tbody>
        
        <tfoot>
          <tr align="right">
            <td colspan="6"><?php echo $this->_var['page']; ?></td>
          </tr>
        </tfoot>
      </table>
    </div>
  </form>
</div>
<script type="text/javascript">
$(function(){
	$('.delete').click(function(){
		var title = $(this).attr('title');
		var id = $(this).attr('id');
		$.dialog.confirm('你确定要删除<font color=red>'+title+'</font>吗？', function(){
			location.href="<?php echo $this->_var['site_url']; ?>admin/user/delete/"+id;
		}, function(){
		});
	   
	});
});        
</script>
</body>
</html>